package source

import (
	"gin-myboot/global"
	system "gin-myboot/modules/system/model"
	"github.com/gookit/color"
	"gorm.io/gorm"
)

var Config = new(config)

type config struct{}

//@description: sys_configs 表数据初始化
func (a *config) Init() error {
	return global.GormDB.Transaction(func(tx *gorm.DB) error {
		if tx.Where("id IN ?", []int{57, 58}).Find(&[]system.SysConfig{}).RowsAffected == 2 {
			color.Danger.Println("\n[Mysql] --> sys_configs 表的初始数据已存在!")
			return nil
		}

		sqls := make(map[int]string)

		sqls[0] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (1, '', '系统设置', 'core', '', 'label', NULL, 1, 1, 'core', NULL, '2019-07-27 14:31:10', '2019-08-02 14:37:05', NULL, NULL, 0, NULL, NULL, NULL);"
		sqls[1] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (15, '', '系统字典', 'dict', '', 'label', NULL, 2, 1, 'core', 'null', '2019-07-27 14:31:10', '2021-10-09 17:06:26', NULL, NULL, 0, NULL, NULL, NULL);"
		sqls[2] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (16, 'core', '应用设置', 'app', '{\"name\":\"MyBoot1111\",\"logo\":\"http://qmplusimg.henrongyi.top/1576554439myAvatar.png\",\"abort\":\"\"}', 'single-dynamic-input', NULL, 1, 1, 'core', NULL, '2019-07-27 14:31:10', '2021-10-28 19:37:56', NULL, '', 0, 'JSONString', '{\n    \"name\": {\n      \"label\": \"应用名称\",\n      \"name\": \"name\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"logo\": {\n      \"label\": \"应用LOGO\",\n      \"name\": \"logo\",\n      \"type\": \"single-select-image\",\n      \"value\": null\n    },\n    \"abort\": {\n      \"label\": \"应用简介\",\n      \"name\": \"abort\",\n      \"type\": \"editor\",\n      \"value\": null\n    }\n  }', NULL);"
		sqls[3] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (41, 'dict', '性别', 'sex', '[{\"label\":\"男\",\"value\":\"1\",\"color\":\"\"},{\"label\":\"女\",\"value\":\"2\",\"color\":\"\"}]', 'dict', '', 1, 1, 'dict', '', '2021-09-14 10:11:54', '2021-10-28 19:37:56', NULL, '', 1, 'JSONString', NULL, NULL);"
		sqls[4] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (42, 'dict', '订单状态', 'order-status', '[{\"name\":\"0\",\"value\":\"0\",\"label\":\"未支付\"},{\"name\":\"1\",\"value\":\"1\",\"label\":\"已支付\"},{\"label\":\"已发货\",\"value\":\"2\",\"color\":\"\"}]', 'dict', '', 1, 1, 'dict', '', '2021-09-14 15:45:54', '2021-10-28 19:37:56', NULL, 'type=array,required=true,whitespace=true,message=不能为空', 1, 'JSONString', NULL, NULL);"
		sqls[5] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (43, 'core', 'Reids', 'redis', '{\"addr\":\"127.0.0.1:6379\",\"db\":0,\"password\":\"root\"}', 'single-dynamic-input', NULL, 3, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '[\n  {\n    \"label\": \"地址\",\n    \"name\": \"addr\",\n    \"type\": \"input\",\n    \"value\": \"127.0.0.1:6379\"\n  },\n  {\n    \"label\": \"数据库\",\n    \"name\": \"db\",\n    \"type\": \"input-number\",\n    \"value\": 0\n  },\n  {\n    \"label\": \"密码\",\n    \"name\": \"password\",\n    \"type\": \"password\",\n    \"value\": \"root\"\n  }\n]', NULL);"
		sqls[6] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (44, 'core', 'MySql', 'mysql', '{\"path\":\"127.0.0.1\",\"db-name\":\"myboot\",\"username\":\"root\",\"password\":\"root\"}', 'single-dynamic-input', NULL, 4, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '[\n  {\n    \"label\": \"数据地址\",\n    \"name\": \"path\",\n    \"type\": \"input\",\n    \"value\": \"127.0.0.1:3306\"\n  },\n  {\n    \"label\": \"数据库名称\",\n    \"name\": \"db-name\",\n    \"type\": \"input\",\n    \"value\": \"myboot\"\n  },\n  {\n    \"label\": \"数据库用户\",\n    \"name\": \"username\",\n    \"type\": \"input\",\n    \"value\": \"root\"\n  },\n  {\n    \"label\": \"数据库密码\",\n    \"name\": \"password\",\n    \"type\": \"password\",\n    \"value\": \"root\"\n  }\n]', 1);"
		sqls[7] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (45, 'core', '本地上传配置', 'local', '{\"path\":\"uploads/file\"}', 'single-dynamic-input', NULL, 5, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n  \"path\": {\n    \"label\": \"上传路径\",\n    \"name\": \"path\",\n    \"type\": \"input\",\n    \"value\":\"\"\n  }\n}', NULL);"
		sqls[8] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (46, 'core', '阿里云存储设置', 'aliyun-oss', '{\"access-key-id\":null,\"access-key-secret\":null,\"base-path\":null,\"bucket-name\":null,\"bucket-url\":null,\"endpoint\":null}', 'single-dynamic-input', NULL, 6, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"accessKeyId\": {\n      \"label\": \"accessKeyId\",\n      \"name\": \"access-key-id\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"accessKeySecret\": {\n      \"label\": \"accessKeySecret\",\n      \"name\": \"access-key-secret\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"basePath\": {\n      \"label\": \"basePath\",\n      \"name\": \"base-path\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"bucketName\": {\n      \"label\": \"bucketName\",\n      \"name\": \"bucket-name\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"bucketUrl\": {\n      \"label\": \"bucketUrl\",\n      \"name\": \"bucket-url\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"endpoint\": {\n      \"label\": \"endpoint\",\n      \"name\": \"endpoint\",\n      \"type\": \"input\",\n      \"value\": null\n    }\n  }', NULL);"
		sqls[9] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (47, 'core', 'Timer', 'timer', '{\"detail\":{\"compareField\":\"created_at\",\"interval\":\"2160h\",\"tableName\":\"sys_user_logs\"},\"spec\":\"@daily\",\"start\":true}', 'single-dynamic-input', NULL, 7, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n	\"detail\": {\n		\"label\": \"detail\",\n		\"name\": \"detail\",\n		\"type\": \"single-dynamic-input\",\n		\"value\": null,\n		\"fields\": {\n			\"compareField\": {\n				\"label\": \"compareField\",\n				\"name\": \"compareField\",\n				\"type\": \"input\",\n				\"value\": \"created_at\"\n			},\n			\"interval\": {\n				\"label\": \"interval\",\n				\"name\": \"interval\",\n				\"type\": \"input\",\n				\"value\": \"2160h\"\n			},\n			\"tableName\": {\n				\"label\": \"tableName\",\n				\"name\": \"tableName\",\n				\"type\": \"input\",\n				\"value\": \"sys_user_logs\"\n			}\n		}\n	},\n	\"spec\": {\n		\"label\": \"spec\",\n		\"name\": \"spec\",\n		\"type\": \"input\",\n		\"value\": \"@daily\"\n	},\n	\"start\": {\n		\"label\": \"start\",\n		\"name\": \"start\",\n		\"type\": \"boolean\",\n		\"value\": true\n	}\n}', NULL);"
		sqls[10] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (48, 'core', '阿里大鱼短信设置', 'aldy', '{\"access-key-id\":null,\"access-key-secret\":null,\"sign-name\":null,\"template-code\":null,\"template-param\":null}', 'single-dynamic-input', NULL, 8, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"accessKeyId\": {\n      \"label\": \"accessKeyId\",\n      \"name\": \"access-key-id\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"accessKeySecret\": {\n      \"label\": \"accessKeySecret\",\n      \"name\": \"access-key-secret\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"signName\": {\n      \"label\": \"signName\",\n      \"name\": \"sign-name\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"templateCode\": {\n      \"label\": \"templateCode\",\n      \"name\": \"template-code\",\n      \"type\": \"input\",\n      \"value\": null\n    },\n    \"templateParam\": {\n      \"label\": \"templateParam\",\n      \"name\": \"template-param\",\n      \"type\": \"input\",\n      \"value\": null\n    }\n  }', NULL);"
		sqls[11] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (49, 'core', '基础设置', 'system', '{\"addr\":8888,\"db-type\":\"mysql\",\"env\":\"public\",\"oss-type\":\"local\",\"use-multipoint\":true}', 'single-dynamic-input', NULL, 9, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"addr\": {\n      \"label\": \"addr\",\n      \"name\": \"addr\",\n      \"type\": \"input-number\",\n      \"value\": 8888\n    },\n    \"dbType\": {\n      \"label\": \"dbType\",\n      \"name\": \"db-type\",\n      \"type\": \"select\",\n      \"value\": \"mysql\",\n      \"options\": [\n        \"mysql\"\n      ]\n    },\n    \"env\": {\n      \"label\": \"env\",\n      \"name\": \"env\",\n      \"type\": \"input\",\n      \"value\": \"public\"\n    },\n    \"ossType\": {\n      \"label\": \"ossType\",\n      \"name\": \"oss-type\",\n      \"type\": \"select\",\n      \"value\": \"local\",\n      \"options\": [\n        {\n          \"label\": \"本地\",\n          \"value\": \"local\"\n        },\n        {\n          \"label\": \"七牛\",\n          \"value\": \"qiniu\"\n        },\n        {\n          \"label\": \"阿里云\",\n          \"value\": \"aliyun-oss\"\n        },\n        {\n          \"label\": \"腾讯云\",\n          \"value\": \"Tencent-cos\"\n        }\n      ]\n    },\n    \"useMultipoint\": {\n      \"label\": \"useMultipoint\",\n      \"name\": \"use-multipoint\",\n      \"type\": \"boolean\",\n      \"value\": true\n    }\n  }', NULL);"
		sqls[12] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (50, 'core', '图片验证码设置', 'captcha', '{\"img-height\":240,\"img-width\":80,\"key-long\":4}', 'single-dynamic-input', NULL, 10, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"imgHeight\": {\n      \"label\": \"验证码宽度\",\n      \"name\": \"img-height\",\n      \"type\": \"input-number\",\n      \"value\": 80\n    },\n    \"imgWidth\": {\n      \"label\": \"验证码高度\",\n      \"name\": \"img-width\",\n      \"type\": \"input-number\",\n      \"value\": 240\n    },\n    \"keyLong\": {\n      \"label\": \"验证码长度\",\n      \"name\": \"key-long\",\n      \"type\": \"input-number\",\n      \"value\": 4\n    }\n  }', NULL);"
		sqls[13] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (51, 'core', '邮箱设置', 'email', '{\"from\":\"xxx\",\"host\":\"xxx\",\"is-ssl\":false,\"nickname\":\"xxx\",\"port\":465,\"secret\":\"xxx\",\"to\":\"xxx@qq.com\"}', 'single-dynamic-input', NULL, 11, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"from\": {\n      \"label\": \"from\",\n      \"name\": \"from\",\n      \"type\": \"input\",\n      \"value\": \"xxx\"\n    },\n    \"host\": {\n      \"label\": \"host\",\n      \"name\": \"host\",\n      \"type\": \"input\",\n      \"value\": \"xxx\"\n    },\n    \"isSsl\": {\n      \"label\": \"isSsl\",\n      \"name\": \"is-ssl\",\n      \"type\": \"boolean\",\n      \"value\": true\n    },\n    \"nickname\": {\n      \"label\": \"nickname\",\n      \"name\": \"nickname\",\n      \"type\": \"input\",\n      \"value\": \"xxx\"\n    },\n    \"port\": {\n      \"label\": \"port\",\n      \"name\": \"port\",\n      \"type\": \"input\",\n      \"value\": 465\n    },\n    \"secret\": {\n      \"label\": \"secret\",\n      \"name\": \"secret\",\n      \"type\": \"input\",\n      \"value\": \"xxx\"\n    },\n    \"to\": {\n      \"label\": \"to\",\n      \"name\": \"to\",\n      \"type\": \"input\",\n      \"value\": \"xxx@qq.com\"\n    }\n  }', NULL);"
		sqls[14] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (52, 'core', 'Excel 设置', 'excel', '{\"dir\":\"./resource/excel/\"}', 'single-dynamic-input', NULL, 12, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"dir\": {\n      \"label\": \"Excel 存储目录\",\n      \"name\": \"dir\",\n      \"type\": \"input\",\n      \"value\": \"./resource/excel/\"\n    }\n  }', NULL);"
		sqls[15] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (53, 'core', 'JWT 设置', 'jwt', '{\"buffer-time\":86400,\"expires-time\":604800,\"signing-key\":\"myBoot\"}', 'single-dynamic-input', NULL, 13, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"bufferTime\": {\n      \"label\": \"bufferTime\",\n      \"name\": \"buffer-time\",\n      \"type\": \"input\",\n      \"value\": 86400\n    },\n    \"expiresTime\": {\n      \"label\": \"JWT 过期时间（秒）\",\n      \"name\": \"expires-time\",\n      \"type\": \"input\",\n      \"value\": 604800\n    },\n    \"signingKey\": {\n      \"label\": \"JWT key\",\n      \"name\": \"signing-key\",\n      \"type\": \"input\",\n      \"value\": \"myBoot\"\n    }\n  }', NULL);"
		sqls[16] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (54, 'core', 'ZAP日志设置', 'zap', '{\"director\":\"log\",\"encode-level\":\"LowercaseColorLevelEncoder\",\"format\":\"console\",\"level\":\"\",\"link-name\":\"latest_log\",\"log-in-console\":false,\"prefix\":\"[GIN-MYBOOT]\",\"showline\":false,\"stacktrace-key\":\"stacktrace\"}', 'single-dynamic-input', NULL, 14, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"director\": {\n      \"label\": \"director\",\n      \"name\": \"director\",\n      \"type\": \"input\",\n      \"value\": \"log\"\n    },\n    \"encodeLevel\": {\n      \"label\": \"encodeLevel\",\n      \"name\": \"encode-level\",\n      \"type\": \"input\",\n      \"value\": \"LowercaseColorLevelEncoder\"\n    },\n    \"format\": {\n      \"label\": \"format\",\n      \"name\": \"format\",\n      \"type\": \"input\",\n      \"value\": \"console\"\n    },\n    \"level\": {\n      \"label\": \"level\",\n      \"name\": \"level\",\n      \"type\": \"select\",\n      \"value\": \"info\",\n      \"options\": [\n        \"debug\",\n        \"error\",\n        \"info\"\n      ]\n    },\n    \"linkName\": {\n      \"label\": \"linkName\",\n      \"name\": \"link-name\",\n      \"type\": \"input\",\n      \"value\": \"latest_log\"\n    },\n    \"logInConsole\": {\n      \"label\": \"logInConsole\",\n      \"name\": \"log-in-console\",\n      \"type\": \"boolean\",\n      \"value\": true\n    },\n    \"prefix\": {\n      \"label\": \"prefix\",\n      \"name\": \"prefix\",\n      \"type\": \"input\",\n      \"value\": \"[GIN-MYBOOT]\"\n    },\n    \"showline\": {\n      \"label\": \"showline\",\n      \"name\": \"showline\",\n      \"type\": \"boolean\",\n      \"value\": true\n    },\n    \"stacktraceKey\": {\n      \"label\": \"stacktraceKey\",\n      \"name\": \"stacktrace-key\",\n      \"type\": \"input\",\n      \"value\": \"stacktrace\"\n    }\n  }', NULL);"
		sqls[17] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (55, 'core', '腾讯云存储设置', 'tencent-cos', '{\"base-url\":\"https://gin.vue.admin\",\"bucket\":\"xxxxx-10005608\",\"path-prefix\":\"gin-myboot\",\"region\":\"ap-shanghai\",\"secret-id\":\"xxxxxxxx\",\"secret-key\":\"xxxxxxxx\"}', 'single-dynamic-input', NULL, 15, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '{\n    \"baseUrl\": {\n      \"label\": \"baseUrl\",\n      \"name\": \"base-url\",\n      \"type\": \"input\",\n      \"value\": \"https://gin.vue.admin\"\n    },\n    \"bucket\": {\n      \"label\": \"bucket\",\n      \"name\": \"bucket\",\n      \"type\": \"input\",\n      \"value\": \"xxxxx-10005608\"\n    },\n    \"pathPrefix\": {\n      \"label\": \"pathPrefix\",\n      \"name\": \"path-prefix\",\n      \"type\": \"input\",\n      \"value\": \"gin-myboot\"\n    },\n    \"region\": {\n      \"label\": \"region\",\n      \"name\": \"region\",\n      \"type\": \"input\",\n      \"value\": \"ap-shanghai\"\n    },\n    \"secretId\": {\n      \"label\": \"secretId\",\n      \"name\": \"secret-id\",\n      \"type\": \"input\",\n      \"value\": \"xxxxxxxx\"\n    },\n    \"secretKey\": {\n      \"label\": \"secretKey\",\n      \"name\": \"secret-key\",\n      \"type\": \"input\",\n      \"value\": \"xxxxxxxx\"\n    }\n  }', NULL);"
		sqls[18] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (57, 'core', '代码生成设置', 'autocode', '{\"root\":\"/Users/mac/Dev/go/gin-vue-admin\",\"server\":\"/server\",\"server-api\":\"/api/v1/autocode\",\"server-initialize\":\"/initialize\",\"server-model\":\"/model/autocode\",\"server-request\":\"/model/autocode/request/\",\"server-router\":\"/router/autocode\",\"server-service\":\"/service/autocode\",\"transfer-restart\":true,\"web\":\"/web/src\",\"web-api\":\"/api\",\"web-flow\":\"/view\",\"web-form\":\"/view\",\"web-table\":\"/view\"}', 'single-dynamic-input', NULL, 16, 1, 'core', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', ' {\n    \"root\": {\n      \"label\": \"root\",\n      \"name\": \"root\",\n      \"type\": \"input\",\n      \"value\": \"/Users/mac/Dev/go/gin-vue-admin\"\n    },\n    \"server\": {\n      \"label\": \"server\",\n      \"name\": \"server\",\n      \"type\": \"input\",\n      \"value\": \"/server\"\n    },\n    \"server-api\": {\n      \"label\": \"server-api\",\n      \"name\": \"server-api\",\n      \"type\": \"input\",\n      \"value\": \"/api/v1/autocode\"\n    },\n    \"server-initialize\": {\n      \"label\": \"server-initialize\",\n      \"name\": \"server-initialize\",\n      \"type\": \"input\",\n      \"value\": \"/initialize\"\n    },\n    \"server-model\": {\n      \"label\": \"server-model\",\n      \"name\": \"server-model\",\n      \"type\": \"input\",\n      \"value\": \"/model/autocode\"\n    },\n    \"server-request\": {\n      \"label\": \"server-request\",\n      \"name\": \"server-request\",\n      \"type\": \"input\",\n      \"value\": \"/model/autocode/request/\"\n    },\n    \"server-router\": {\n      \"label\": \"server-router\",\n      \"name\": \"server-router\",\n      \"type\": \"input\",\n      \"value\": \"/router/autocode\"\n    },\n    \"server-service\": {\n      \"label\": \"server-service\",\n      \"name\": \"server-service\",\n      \"type\": \"input\",\n      \"value\": \"/service/autocode\"\n    },\n    \"transfer-restart\": {\n      \"label\": \"transfer-restart\",\n      \"name\": \"transfer-restart\",\n      \"type\": \"boolean\",\n      \"value\": true\n    },\n    \"web\": {\n      \"label\": \"web\",\n      \"name\": \"web\",\n      \"type\": \"input\",\n      \"value\": \"/web/src\"\n    },\n    \"web-api\": {\n      \"label\": \"web-api\",\n      \"name\": \"web-api\",\n      \"type\": \"input\",\n      \"value\": \"/api\"\n    },\n    \"web-flow\": {\n      \"label\": \"web-flow\",\n      \"name\": \"web-flow\",\n      \"type\": \"input\",\n      \"value\": \"/view\"\n    },\n    \"web-form\": {\n      \"label\": \"web-form\",\n      \"name\": \"web-form\",\n      \"type\": \"input\",\n      \"value\": \"/view\"\n    },\n    \"web-table\": {\n      \"label\": \"web-table\",\n      \"name\": \"web-table\",\n      \"type\": \"input\",\n      \"value\": \"/view\"\n    }\n  }', NULL);"
		sqls[19] = "INSERT INTO `sys_configs` (`id`, `parent_name`, `label`, `name`, `value`, `type`, `description`, `sort_order`, `status`, `module`, `data_source`, `created_at`, `updated_at`, `deleted_at`, `rule_source`, `multiple`, `value_type`, `fields`, `limit`) VALUES (58, 'dict', '动态测试', 'dynamic', '[{\"label\":\"未支付\",\"name\":\"order_nopay\",\"value\":\"1\"},{\"label\":\"已支付\",\"name\":\"order_pay\",\"value\":\"2\"}]', 'dynamic-input', NULL, 999999, 1, 'dict', NULL, NULL, '2021-10-28 19:37:56', NULL, NULL, 0, 'JSONString', '[{\n		\"label\": \"中文名\",\n		\"name\": \"label\",\n		\"type\": \"input\",\n		\"value\": \"\"\n	},\n	{\n		\"label\": \"英文名\",\n		\"name\": \"name\",\n		\"type\": \"input\",\n		\"value\": \"\"\n	},\n	{\n		\"label\": \"值\",\n		\"name\": \"value\",\n		\"type\": \"input\",\n		\"value\": \"\"\n	}\n]', NULL);"

		for _, sql := range sqls {
			if err := global.GormDB.Exec(sql).Error; err != nil {
				return err
			}
		}
		color.Info.Println("\n[Mysql] --> sys_configs 表初始数据成功!")
		return nil
	})
}
